'''
用函数实现一个具有加, 减, 乘, 除, 整除, 取余, 开方的计算器

my_calculator.py

def add(a, b):

def sqrt(a, b):

'''
def add(a,b):
    return a + b ;
def sub(a,b):
    return a - b;
def mul(a,b):
    return a * b;
def div(a,b):
    if b != 0:
        return a / b;
    else:
        return "除数不能为零！！！"
def rem(a,b):
    return a // b;
def ediv(a,b):
    return a % b;
def sqrt(a):
    c = int(a)
    if c>=0:
        return c ** (1/2);
    else:
        return "开方数不能小于零？";
c = input("请输入你的运算符号：‘+、-、*、/，//，%，开方：%%：")
# input3 = input("请输入你要开方的数，如果不是进行开方运算请按回车键")

if c == '%%':
    a = float(input("请输入你要开方的数:"))
    print(a,"^(1/2)","=",sqrt(a))
else:
    a = float(input("请输入你要运算的第一个数："))
    b = float(input("请输入你要运算的第二个数："))
    # c = input("请输入你的运算符号：‘+、-、*、/，//，%，开方：%%")
    if c == '+':
        print(a,"+",b,"=",add(a,b))
    elif c == '-':
        print(a,"-",b,"=",sub(a,b))
    elif c == '*':
        print(a,"*",b,"=",mul(a,b))
    elif c == '-':
        print(a,"/",b,"=",div(a,b))
    elif c == '-':
        print(a,"//",b,"=",ediv(a,b))
    elif c == '-':
        print(a,"%",b,"=",rem(a,b))
    elif c == '-':
        print(a,"^(1/2)",b,"=",sqrt(a,b))
    else :
        print("请输入正确的运算？")
